home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume5 / startx / part01 next >
Encoding:
Internet Message Format  |  1989-12-18  |  45.4 KB

  1. Path: uunet!ssbell!kent@ssbell.uu.net
  2. From: kent@ssbell.uu.net (Kent Landfield)
  3. Newsgroups: comp.sources.x
  4. Subject: v05i049: startx - X Windows session initiator, Part01/01
  5. Message-ID: <598@ssbell.uu.net>
  6. Date: 18 Dec 89 21:02:25 GMT
  7. Sender: kent@ssbell.uu.net
  8. Lines: 1493
  9. Approved: kent@ssbell.uu.net (Kent Landfield)
  10.  
  11. Submitted-by: George Kraft IV <gk4@staff.cc.purdue.edu>
  12. Posting-number: Volume 5, Issue 49
  13. Archive-name: startx/part01
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then feed it
  17. # into a shell via "sh file" or similar.  To overwrite existing files,
  18. # type "sh file -c".
  19. # If this archive is complete, you will see the following message at the end:
  20. #        "End of archive 1 (of 1)."
  21. # Contents:  startx startx/Imakefile startx/Imakefile.pucc startx/lib
  22. #   startx/lib/twmrc startx/lib/xdefaults startx/lib/xsession
  23. #   startx/startx.1l startx/startx.NewsLetter startx/startx.cpp
  24. #   startx/startx.newsletter
  25. # Wrapped by kent@ssbell.uu.net on Mon Dec 18 14:45:38 1989
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test ! -d 'startx' ; then
  28.     echo shar: Creating directory \"'startx'\"
  29.     mkdir 'startx'
  30. fi
  31. if test -f 'startx/Imakefile' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'startx/Imakefile'\"
  33. else
  34. echo shar: Extracting \"'startx/Imakefile'\" \(163 characters\)
  35. sed "s/^X//" >'startx/Imakefile' <<'END_OF_FILE'
  36. X
  37. XPROGRAMS = startx
  38. X
  39. XMakeScriptFromCpp(startx, -DBINDIR=$(BINDIR) -DUNSUPBINDIR=$(UNSUPBINDIR))
  40. X
  41. XInstallProgram(startx,$(BINDIR))
  42. X
  43. Xclean::
  44. X    /bin/rm -rf $(PROGRAMS)
  45. END_OF_FILE
  46. if test 163 -ne `wc -c <'startx/Imakefile'`; then
  47.     echo shar: \"'startx/Imakefile'\" unpacked with wrong size!
  48. fi
  49. # end of 'startx/Imakefile'
  50. fi
  51. if test -f 'startx/Imakefile.pucc' -a "${1}" != "-c" ; then 
  52.   echo shar: Will not clobber existing file \"'startx/Imakefile.pucc'\"
  53. else
  54. echo shar: Extracting \"'startx/Imakefile.pucc'\" \(438 characters\)
  55. sed "s/^X//" >'startx/Imakefile.pucc' <<'END_OF_FILE'
  56. X
  57. XPROGRAMS = startx
  58. X
  59. XMakeScriptFromCpp(startx, -DBINDIR=$(BINDIR) -DUNSUPBINDIR=$(UNSUPBINDIR))
  60. X
  61. XInstallProgram(startx,$(BINDIR))
  62. X
  63. Xinstall::
  64. X    if [ ! -d $(LIBDIR)/startx ]; then \
  65. X        mkdir $(LIBDIR)/startx ; \
  66. X        chmod 755 $(LIBDIR)/startx ; \
  67. X    else \
  68. X        exit 0; \
  69. X    fi
  70. X
  71. XInstallNonExec(lib/xdefaults, $(LIBDIR)/startx)
  72. XInstallNonExec(lib/twmrc, $(LIBDIR)/startx)
  73. XInstallNonExec(lib/xsession, $(LIBDIR)/startx)
  74. X
  75. Xclean::
  76. X    /bin/rm -rf $(PROGRAMS)
  77. END_OF_FILE
  78. if test 438 -ne `wc -c <'startx/Imakefile.pucc'`; then
  79.     echo shar: \"'startx/Imakefile.pucc'\" unpacked with wrong size!
  80. fi
  81. # end of 'startx/Imakefile.pucc'
  82. fi
  83. if test ! -d 'startx/lib' ; then
  84.     echo shar: Creating directory \"'startx/lib'\"
  85.     mkdir 'startx/lib'
  86. fi
  87. if test -f 'startx/lib/twmrc' -a "${1}" != "-c" ; then 
  88.   echo shar: Will not clobber existing file \"'startx/lib/twmrc'\"
  89. else
  90. echo shar: Extracting \"'startx/lib/twmrc'\" \(4458 characters\)
  91. sed "s/^X//" >'startx/lib/twmrc' <<'END_OF_FILE'
  92. X#    Purdue University Computing Center
  93. X#    George Kraft IV, Unix Systems Staff
  94. X#
  95. X#    .twmrc file to be read by twm(1L) started in file .xsession
  96. X#
  97. X
  98. XBorderWidth        1
  99. XZoom            2
  100. XForceIcons
  101. XShowIconManager
  102. XIconifyByUnmapping
  103. XIconDirectory        "/share/icons"
  104. XIconManagerGeometry    "175x80-1+80"
  105. XDefaultFunction        f.beep
  106. XIconFont        "9x15"
  107. XTitleFont        "9x15"
  108. XMenuFont        "9x15"
  109. X
  110. XButton1 =      : root    : f.menu "Hosts"
  111. XButton1 =      : title     : f.raise
  112. XButton1 =      : frame   : f.raise
  113. XButton1 =      : icon     : f.iconify
  114. X
  115. XButton2 =      : root    : f.menu "TWM"
  116. XButton2 =      : title   : f.move
  117. XButton2 =      : frame   : f.move
  118. XButton2 =      : icon     : f.move
  119. X
  120. XButton3 =      : root     : f.menu "Tools"
  121. XButton3 =      : title     : f.fullzoom
  122. XButton3 =      : frame     : f.lower
  123. X
  124. XIconManagerDontShow {
  125. X    "xlogin"
  126. X    "xbiff"
  127. X    "xload"
  128. X    "dclock"
  129. X    "xclock"
  130. X    "xpostit"
  131. X    "dayEditor"
  132. X    "PostItNote"
  133. X    "TWM Icon Manager"
  134. X}
  135. X
  136. XAutoRaise {
  137. X    "TWM Icon Manager"
  138. X    "xpostit"
  139. X    "xcalc"
  140. X    "xfig"
  141. X    "dclock"
  142. X    "xclock"
  143. X    "xload"
  144. X    "xterm"
  145. X    "xcalendar"
  146. X    "dayEditor"
  147. X}
  148. X
  149. XDontIconifyByUnmapping {
  150. X    "xbiff"
  151. X    "dclock"
  152. X    "xclock"
  153. X    "xpostit"
  154. X    "PostItNote"
  155. X    "TWM Icon Manager"
  156. X}
  157. X
  158. XNoTitle {
  159. X    "POSTSCRIPT"
  160. X    "xfd"
  161. X    "xpostit"
  162. X    "xlogo"
  163. X    "xbiff"
  164. X    "dclock"
  165. X    "xclock"
  166. X    "PostItNote"
  167. X    "postitnote"
  168. X    "xpostitnote"
  169. X    "TWM Icon Manager"
  170. X}
  171. X
  172. X#
  173. X#    Use the TWM Window Manager instead.
  174. X#
  175. X#    UnknownIcon        "huh.xbm"
  176. X#
  177. X#    IconGeometry {
  178. X#        "xterm"        "20x20+100+100"
  179. X#        "console"    "20x20+100+300"
  180. X#        "xbiff"        "20x20+100+400"
  181. X#    }
  182. X#
  183. X#    Icons {
  184. X#        "xterm"            "xterm.xbm"
  185. X#        "xbiff"            "huh.xbm"
  186. X#        "xps"             "coke.xbm"
  187. X#        "bitmap"         "coke.xbm"
  188. X#        "console"         "console.xbm"
  189. X#        "xfd"             "xfd_icon"
  190. X#    }
  191. X
  192. XMenu "Hosts" {
  193. X    "Remote Logins by Dept"    f.title
  194. X    "LocalHost"         !"xterm -T `hostname` &"
  195. X    "PUCC"            f.menu "PUCC"
  196. X    "STAT"            f.menu "STAT"
  197. X    "ECN"            f.menu "ECN"
  198. X    "CS"            f.menu "CS"
  199. X}
  200. X
  201. X
  202. XMenu "PUCC" {
  203. X    "Computing Center"    f.title
  204. X    "boiler   # ETA 10P*"    !"xterm -T Boiler.cc -tn xterms -e rlogin boiler.cc &"
  205. X    "element  # Sun 3/280"     !"xterm -T Element.cc -e rlogin element.cc &"
  206. X    "expert   # Sequent S81" !"xterm -T Expert.cc -e rlogin expert.cc &"
  207. X    "h        # Vax 11/780"  !"xterm -T H.cc -e rlogin h.cc    &"
  208. X    "j        # Vax 11/780"  !"xterm -T J.cc -e rlogin j.cc    &"
  209. X    "m        # Vax 11/780"     !"xterm -T M.cc -e rlogin m.cc    &"
  210. X    "mace     # Vax 8800"      !"xterm -T Mace.cc -e rlogin mace.cc &"
  211. X    "mentor   # Sequent S81" !"xterm -T Mentor.cc -e rlogin mentor.cc &"
  212. X    "n        # Vax 11/780"     !"xterm -T N.cc -e rlogin n.cc    &"
  213. X    "sage     # Sequent S81" !"xterm -T Sage.cc -e rlogin sage.cc &"
  214. X    "staff    # Sun 3/280"     !"xterm -T Staff.cc -e rlogin staff.cc &"
  215. X    "tyro     # Sequent S81" !"xterm -T Tyro.cc -e rlogin tyro.cc &"
  216. X    "vm       # IBM 3090-180E" !"xterm -T PURCCVM -name vmxterm -e tn3270 vm.cc &"
  217. X}
  218. X
  219. XMenu "STAT" {
  220. X    "Statistics"    f.title
  221. X    "l        # Vax 11/780"     !"xterm -T L.cc -e rlogin l.cc &"
  222. X    "pop.stat # Sun 3/280"     !"xterm -T Pop.stat -e rlogin pop.stat &"
  223. X}
  224. X
  225. XMenu "ECN" {
  226. X    "Engineering Computing Network"    f.title
  227. X    "ea         # Vax 11/780" !"xterm -T Ea.ecn -e rlogin ea.ecn &"
  228. X    "orchestra  # Sun 3/280" !"xterm -T Orchestra.ecn -e rlogin orchestra.ecn &"
  229. X}
  230. X
  231. X
  232. XMenu "CS" {
  233. X    "Computer Science"    f.title
  234. X    "arthur  # Sequent B21" !"xterm -T Arthur.cs -e rlogin arthur.cs &"
  235. X}
  236. X
  237. Xmenu "Tools" {
  238. X    "Tools"            f.title
  239. X    "dclock"        !"dclock &"
  240. X    "index"            !"xterm -e index &"
  241. X    "xbiff"            !"xbiff &"
  242. X    "xcalendar"        !"xcalendar &"
  243. X    "xfig"            !"xfig -L &"
  244. X    "xcalc"            !"xcalc &"
  245. X    "xclip"            !"xclipboard &"
  246. X    "xpostit"        !"xpostit &"
  247. X    "Print X Window"    !"xwd | xpr -device ps | lpr &"
  248. X    "Dump  X Window"    !"(xwd | xwdtopbm | pbmtoxbm > dump$$.xbm &)"
  249. X}
  250. X
  251. X
  252. Xmenu "TWM" {
  253. X    "Tom's Window Manager"    f.title
  254. X    "Refresh"        f.refresh
  255. X    "Source .twmrc"        f.twmrc
  256. X    "Destroy Window"    f.destroy
  257. X    "(De)Iconify"        f.iconify
  258. X    "Show Icon Mgr"        f.showiconmgr
  259. X    "Full Zoom/UnZoom"    f.fullzoom
  260. X    "Focus on Window"    f.focus
  261. X    "Root Window Focus"    f.unfocus
  262. X    "Move Window"        f.move
  263. X    "Resize Window"        f.resize
  264. X    "Raise Window"        f.raise
  265. X    "Lower Window"        f.lower
  266. X    "Cut File"        f.cutfile
  267. X    "Kill twm"        f.quit
  268. X    "Root Window"        f.menu "RtWindow"
  269. X}
  270. X
  271. X
  272. Xmenu "RtWindow" {
  273. X    "Root Window"    f.title
  274. X    "black"        !"xsetroot -solid black &"
  275. X    "grey"        !"xsetroot -grey &"
  276. X    "PUCC white"    !"xsetroot -bitmap /share/icons/pucc.xbm &"
  277. X    "PUCC black"    !"xsetroot -bitmap /share/icons/pucc.xbm -rv &"
  278. X    "balls3"    !"xsetroot -bitmap /share/icons/balls3.xbm &"
  279. X    "astronaut"    !"xsetroot -bitmap /share/icons/astronaut.xbm &"
  280. X    "fullmoon"    !"xsetroot -bitmap /share/icons/fullmoon.xbm &"
  281. X    "zippy"        !"xsetroot -bitmap /share/icons/zippy.xbm &"
  282. X}
  283. END_OF_FILE
  284. if test 4458 -ne `wc -c <'startx/lib/twmrc'`; then
  285.     echo shar: \"'startx/lib/twmrc'\" unpacked with wrong size!
  286. fi
  287. # end of 'startx/lib/twmrc'
  288. fi
  289. if test -f 'startx/lib/xdefaults' -a "${1}" != "-c" ; then 
  290.   echo shar: Will not clobber existing file \"'startx/lib/xdefaults'\"
  291. else
  292. echo shar: Extracting \"'startx/lib/xdefaults'\" \(635 characters\)
  293. sed "s/^X//" >'startx/lib/xdefaults' <<'END_OF_FILE'
  294. X!    Purdue University Computing Center
  295. X!    George Kraft IV, Unix Systems Staff
  296. X!
  297. X!    .xdefaults file to by read by xrdb(1L) invoked in .xsession
  298. X!
  299. XDClock*Geometry:    175x75-1+0
  300. XDClock*bell:        false
  301. XDClock*scroll:        false
  302. XDClock*date:        %w %M %d, %Y
  303. XXBiff*Geometry:        75x75-176+0
  304. XXBiff*Volume:        100
  305. XXBiff*Interval:        60
  306. XXPostit.Geometry:    75x75-252+0
  307. XXPostit*saveNotes:    true
  308. XXLogin*Iconic:        on
  309. XXTerm*ScrollBar:    on
  310. XXTerm*Geometry:        80x24+250+300
  311. XXTerm*SaveLines:    500
  312. XXTerm*Iconic:        on
  313. XXTerm*Font:        8x13bold
  314. XXTerm*loginShell:    true
  315. XXTerm*UtmpInhibit:    true
  316. XXTerm*VisualBell:    true
  317. XXTerm*pointerShape:    pencil
  318. Xvmxterm*font:        8x13
  319. Xvmxterm*boldFont:    8x13bold
  320. END_OF_FILE
  321. if test 635 -ne `wc -c <'startx/lib/xdefaults'`; then
  322.     echo shar: \"'startx/lib/xdefaults'\" unpacked with wrong size!
  323. fi
  324. # end of 'startx/lib/xdefaults'
  325. fi
  326. if test -f 'startx/lib/xsession' -a "${1}" != "-c" ; then 
  327.   echo shar: Will not clobber existing file \"'startx/lib/xsession'\"
  328. else
  329. echo shar: Extracting \"'startx/lib/xsession'\" \(674 characters\)
  330. sed "s/^X//" >'startx/lib/xsession' <<'END_OF_FILE'
  331. X#!/bin/csh -f
  332. X#
  333. X#    Purdue University Computing Center
  334. X#    George Kraft IV (gk4), Unix Systems Staff
  335. X#
  336. X#    $HOME/.xsession file
  337. X
  338. Xsetenv HOST `hostname | sed -e 's/\.edu$//' -e 's/\.purdue$//' -e 's/\.cc$//'`
  339. X
  340. X(twm &)
  341. X
  342. X#
  343. X#    Load defaults after the window manage is started.
  344. X#
  345. X
  346. Xxrdb -load .xdefaults
  347. X(xsetroot -gray -cursorfont XC_iron_cross &)
  348. X(xset -c r &)
  349. X(dclock &)
  350. X
  351. Xif ("$HOST" == "expert") then
  352. X    (xbiff &)
  353. Xelse
  354. X    (rsh expert -n /usr/local/X11/xbiff -d $DISPLAY &)
  355. Xendif
  356. X
  357. X#
  358. X#  The last line must be in the foreground, and should be an xterm(1L).
  359. X#
  360. X
  361. Xif ("`tty`" == "/dev/console") then
  362. X    xterm  -g 80x24+0+0 +ut -C -T "CONSOLE $HOST"
  363. Xelse
  364. X    xterm  -g 80x24+0+0 +ut -T "$HOST"
  365. Xendif
  366. END_OF_FILE
  367. if test 674 -ne `wc -c <'startx/lib/xsession'`; then
  368.     echo shar: \"'startx/lib/xsession'\" unpacked with wrong size!
  369. fi
  370. # end of 'startx/lib/xsession'
  371. fi
  372. if test -f 'startx/startx.1l' -a "${1}" != "-c" ; then 
  373.   echo shar: Will not clobber existing file \"'startx/startx.1l'\"
  374. else
  375. echo shar: Extracting \"'startx/startx.1l'\" \(9053 characters\)
  376. sed "s/^X//" >'startx/startx.1l' <<'END_OF_FILE'
  377. X.\" 
  378. X.\"  Copyright 1989 Purdue Research Foundation
  379. X.\" 
  380. X.\"  Permission to use, copy, modify, distribute, and sell this software 
  381. X.\"  and its documentation for any purpose is hereby granted without fee, 
  382. X.\"  provided that the above copyright notice appear in all copies and that 
  383. X.\"  both that copyright notice and this permission notice appear in 
  384. X.\"  supporting documentation, and that the name of Purdue not be used in 
  385. X.\"  advertising or publicity pertaining to distribution of the software 
  386. X.\"  without specific, written prior permission.  Purdue makes no 
  387. X.\"  representations about the suitability of this software for any purpose.  
  388. X.\"  It is provided "as is" without express or implied warranty.
  389. X.\" 
  390. X.\"  PURDUE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
  391. X.\"  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 
  392. X.\"  PURDUE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 
  393. X.\"  ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
  394. X.\"  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 
  395. X.\"  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 
  396. X.\"  SOFTWARE.
  397. X.\" 
  398. X.\"  Author:  George Kraft IV (gk4@staff.cc.purdue.edu)
  399. X.\"           Purdue University Computing Center
  400. X.\"           Mathematical Sciences Building
  401. X.\"           West Lafayette, IN 47907
  402. X.\" 
  403. X.TH STARTX 1L PUCC
  404. X.SH NAME
  405. Xstartx \- robustly start an X windows session
  406. X.SH SYNOPSIS
  407. X.B startx 
  408. X[
  409. X.B -d | -w
  410. X] [
  411. X.B -x
  412. X.I startup
  413. X| [
  414. X.B -r
  415. X.I resources
  416. X] [
  417. X.B -m
  418. X.I window_manager
  419. X]]
  420. X.SH DESCRIPTION
  421. XThere are many ways to initiate an X windows session, and \fIstartx\fR
  422. Xis designed to ease the burden on the user.  First, \fIstartx\fR sets the user's
  423. X\fBDISPLAY\fR environment variable to identify the X server to the X clients.
  424. XNext a distinction is made between the user's use of a workstation or an X
  425. Xdisplay station, then the appropriate invocation is made to get the X windows
  426. Xsession started.  This invocation entails starting the X server & X clients for
  427. Xa workstation, or starting the X clients for an X display station.
  428. X.LP
  429. X\fIStartx\fR redirects X server and X client error messages to the file 
  430. Xspecified by the user's \fBXERRORS\fR environment variable.  This is very
  431. Xuseful for debugging, and gives X a clean startup & shutdown appearance on 
  432. Xworkstations.
  433. X.LP
  434. XYou should note that you can use one or both of the \fB\-m\fR and \fB\-r\fR
  435. Xoptions, or the \fB\-x\fR option, but you cannot use the \fB\-x\fR option
  436. Xin conjunction with the \fB\-m\fR and \fB\-r\fR options.  In the \fIstartup\fR
  437. Xscript, it is the responsibility of the user to start a window manager, load 
  438. XX resources, & spawn X clients.
  439. X.LP
  440. XIf no \fIstartup\fR script file name is given at the command line with
  441. Xthe \fB\-x\fR option,
  442. Xthen \fIstartx\fR looks for a file named in the user's \fBXINITRC\fR 
  443. Xenvironment variable.  If \fBXINITRC\fR is not set, then \fIstartx\fR
  444. Xlooks in the user's home directory for a file 
  445. Xcalled \fI.Xinit, .xinit, .Xinitrc, .xinitrc,\fR 
  446. Xor \fI.xsession,\fR respectively, to begin the X client programs.
  447. X.LP
  448. XIf no \fIstartup\fR file is found, \fIstartx\fR runs the
  449. X\fIwindow_manager\fR indicated at the command line with the \fB\-m\fR option, 
  450. Xor invokes the window manager \fItwm\fR(1L), \fIawm\fR(1L), or \fIuwm\fR(1L) 
  451. Xafter finding the associated configuration files \fI .twmrc, .awmrc,\fR 
  452. Xor \fI .uwmrc\fR respectively.  If a window manager configuration 
  453. Xfile is not found in the user's home directory, \fIstartx\fR initiates 
  454. Xan \fIxterm\fR(1L) client and the \fItwm\fR(1L) window manager.
  455. X.LP
  456. XWhen no \fIstartup\fR file is found, \fIstartx\fR also instructs the 
  457. Xload of the \fIresources\fR file given at the command line with the \fB\-r\fR
  458. Xoption, or a file from the user's home directory 
  459. Xcalled \fI.Xdefaults, .xdefaults, .Xresources,\fR 
  460. Xor \fI.xresources,\fR respectively.  If an X \fIresources\fR files if not 
  461. Xfound, then the X windows session will not be personalized.
  462. X.SH OPTIONS
  463. X.IP "\fB-d\fR" 20
  464. XStart X clients for an X display station.  
  465. X.IP "\fB-w\fR" 20
  466. XStart the X server and X clients for an X window session on a 
  467. Xworkstation.  
  468. X.IP "\fB-x\fR \fIstartup\fR" 20
  469. XStart an X windows session using the \fIstartup\fR script.
  470. X.IP "\fB-r\fR \fIresources\fR" 20
  471. XLoad the \fIresources\fR file when no \fIstartup\fR script is found. 
  472. X.IP "\fB-m\fR \fIwindow_manager\fR" 20
  473. XStart the \fIwindow_manager\fR when no \fIstartup\fR scripts is found. 
  474. X.SH EXAMPLES
  475. X.IP "startx" 20
  476. XStart an X windows session on a workstation, or for an X display station.
  477. X.IP "startx -w" 20
  478. XForce start an X windows session on a workstation.
  479. X.IP "startx; kill -9 $$" 20
  480. XUseful for starting an X Windows session for an X display station, and
  481. Xlogging off the user's \fItelnet\fR(1C) session.
  482. X.IP "startx -x \fI.xinitrc\fR" 20
  483. XStart an X windows session using the \fI.xinitrc\fR script.
  484. X.IP "startx -w \fItwm\fR" 20
  485. XStart an X windows session using the \fItwm\fR window manager; however, if
  486. Xa \fIstartup\fR script file is found, then the \fB\-w\fR option is ignored.
  487. X.SH "EXAMPLE STARTUP SCRIPT"
  488. X.LP
  489. XIn the \fIstartup\fR script, it is the responsibility of the user to start
  490. Xa window manager, load X resources, & spawn X clients.  Below is an 
  491. Xexample \fI.xsession\fR script.
  492. X.sp
  493. X.RS
  494. X.nf
  495. X#!/bin/csh
  496. X(twm &)
  497. Xxrdb -load .xdefaults
  498. X(xclock -g 75x75+0+0 &)
  499. X(xbiff  -g 75x75+101-0 &)
  500. Xif ("/dev/console" == "`tty`") then
  501. X        xterm -g 80x24+0+0 +ut -C -T `hostname`
  502. Xelse
  503. X        xterm -g 80x24+0+0 +ut -T `hostname`
  504. Xendif
  505. X.fi
  506. X.RE
  507. X.LP
  508. XFor a workstation, the last line in the \fIstartup\fR script 
  509. Xshould be a foreground \fIxterm\fR(1L) with the \fB-C\fR option for console 
  510. Xmessages.  
  511. X.LP
  512. XFor an X display station, the last line in the \fIstartup\fR script 
  513. Xshould be a foreground \fIxterm\fR(1L) without the \fB-C\fR option.  
  514. XAlso, some X display stations will not terminate the \fItelnet\fR(1C)
  515. Xsession upon closing; therefore, one should \fIexec\fR(1) \fIstartx\fR
  516. Xto over write the current \fItelnet\fR(1C) session and begin the X windows 
  517. Xsession.
  518. X.SH ENVIRONMENT VARIABLES
  519. X.IP "\fBDISPLAY\fR" 20
  520. XThe name of the X server to which X clients should connect to.
  521. X.IP "\fBXERRORS\fR" 20
  522. XWhere \fIstartx\fR is to redirect error messages.  By default, \fIstartx\fR 
  523. Xredirects errors to the file \fI.xerrors\fR in user's home directory.
  524. X.IP "\fBXINITRC\fR" 20
  525. XAn \fIstartup\fR file containing shell commands to start a window manager,
  526. Xload X resources, & spawn X clients.
  527. X.SH TERMINOLOGY
  528. X.IP "workstation" 20
  529. XA multi-purpose host computer, normally with a bitmap display and a mouse.
  530. XThe X server & X clients run on the workstation.
  531. X.IP "window manager" 20
  532. XA program which allows you to move, resize, and circulate windows on your 
  533. Xdisplay.
  534. X.IP "X display station" 20
  535. XIs a machine dedicated as an X server.  Only the X server runs on the
  536. XX display station.
  537. X.IP "X client" 20
  538. XA program that performs a task such as terminal emulation, clock,
  539. Xor window management.
  540. X.IP "X resources" 20
  541. XAre the user preferences of your environment such as screen size &
  542. Xplacement, border & background color, and window title & scroll bars.
  543. Xetc.
  544. X.IP "X server" 20
  545. XIs a combination of the graphics display, keyboard, mouse, hardware, and X 
  546. Xserver software which accepts input from these devices and provides display
  547. Xservices for X clients.
  548. X.SH BUGS
  549. X.LP
  550. XFor a workstation if a \fIstartup\fR exists & no \fIresources\fR are loaded
  551. Xby the user, then \fIxinit\fR(1L) within \fIstartx\fR will try to load 
  552. Xan \fI.Xdefaults\fR file.
  553. X.LP
  554. XThe use of a workstation is assumed when the X session is being initiated
  555. Xfrom \fI/dev/console\fR.  If this is not the case, then user must use
  556. Xthe \fB-d\fR, or \fB-w\fR option.  See \fItty\fR(1) for more details.
  557. X.LP
  558. XThe multitude of names for the same files is confusing; however, \fIstartx\fR
  559. Xincludes these historical names for robustness.
  560. X.SH AUTHOR
  561. XCopyright 1989 Purdue Research Foundation
  562. X.br
  563. XGeorge Kraft IV, Purdue University Computing Center
  564. X.br
  565. Xgk4@staff.cc.purdue.edu
  566. X.SH SEE ALSO
  567. Xawm(1U), tty(1), twm(1L), uwm(1L), X(1L), xdm(1U), xinit(1L), xrdb(1L), xterm(1L)
  568. X.br
  569. XO'Reilly & Associates, \fBX Window System User's Guide,\fR 1988.
  570. X.SH FILES
  571. X.IP $HOME/.xerrors 20
  572. XSee \fBXERRORS\fR above.
  573. X.IP $HOME/.Xinit 20
  574. XSee \fBXINITRC\fR above.
  575. X.IP $HOME/.xinit 20
  576. XSee \fBXINITRC\fR above.
  577. X.IP $HOME/.Xinitrc 20
  578. XSee \fBXINITRC\fR above.
  579. X.IP $HOME/.xinitrc 20
  580. XSee \fBXINITRC\fR above.
  581. X.IP $HOME/.xsession 20
  582. XSee \fBXINITRC\fR above.
  583. X.IP $HOME/.Xdefaults 20
  584. XX \fIresources\fR file loaded to set user preferences for X clients.
  585. X.IP $HOME/.xdefaults 20
  586. XX \fIresources\fR file loaded to set user preferences for X clients.
  587. X.IP $HOME/.Xresources 20
  588. XX \fIresources\fR file loaded to set user preferences for X clients.
  589. X.IP $HOME/.xresources 20
  590. XX \fIresources\fR file loaded to set user preferences for X clients.
  591. X.IP $HOME/.twmrc 20
  592. X.IR twm (1L)
  593. Xconfiguration file.
  594. X.IP $HOME/.awmrc 20
  595. X.IR awm (1L)
  596. Xconfiguration file.
  597. X.IP $HOME/.uwmrc 20
  598. X.IR uwm (1L)
  599. Xconfiguration file.
  600. X.IP /dev/console 20
  601. XThe \fItty\fR(4) of a workstation's initial \fIlogin\fR(1) shell.
  602. END_OF_FILE
  603. if test 9053 -ne `wc -c <'startx/startx.1l'`; then
  604.     echo shar: \"'startx/startx.1l'\" unpacked with wrong size!
  605. fi
  606. # end of 'startx/startx.1l'
  607. fi
  608. if test -f 'startx/startx.NewsLetter' -a "${1}" != "-c" ; then 
  609.   echo shar: Will not clobber existing file \"'startx/startx.NewsLetter'\"
  610. else
  611. echo shar: Extracting \"'startx/startx.NewsLetter'\" \(8332 characters\)
  612. sed "s/^X//" >'startx/startx.NewsLetter' <<'END_OF_FILE'
  613. X
  614. X-----------------------------------------------------------------------
  615. X
  616. X               The Syntax of the UNIX Startx Utility
  617. X
  618. XThe syntax of the UNIX startx command and its options is
  619. X
  620. Xstartx [-d | -w] [-x startup | [-r resources | -m window_manager] ]
  621. X
  622. Xwhich represents two sets of options.  The first set consists of
  623. Xthe mutually exclusive options -d or -w which helps startx
  624. Xdistinguish which type of terminal you are using.  These options
  625. Xwill only be used in rare circumstances and you should consult the
  626. Xmanual page for more details.
  627. X
  628. XThe second set of options consists of a choice between setting up
  629. Xyour X Window System environment with one shell script file using
  630. Xthe -x option, or by specifying your X resources and window manager
  631. Xseparately using the -r and -m options.  You should note that you
  632. Xcan use one or both of the -m and -r options, or the -x option, but
  633. Xyou cannot use the -x option in conjunction with the -m and -r
  634. Xoptions.
  635. X
  636. X-----------------------------------------------------------------------
  637. X
  638. X
  639. XUNIX Startx Utility Makes the X Window System Easy
  640. X
  641. XThe X Window System is a network-based graphics window
  642. Xsystem which was developed at the Massachusetts Institute of
  643. XTechnology in 1984.  PUCC hosts run the most recent version
  644. Xof the X Window System, X11.  The X Window System is
  645. Xavailable on all of our Sequent Symmetries, Sun
  646. Xworkstations, and the VAX 8800.
  647. X
  648. XThere are many ways to initiate an X Window System session
  649. Xwhich require you to go through several steps to create a
  650. Xworking environment.  The UNIX startx utility is designed to
  651. Xease your burden by allowing you to start your window
  652. Xmanager, load your X resources, and initiate other X clients
  653. Xwith one command.
  654. X
  655. XWindow Managers, X Resources,
  656. XX Servers and X Clients
  657. X
  658. XIn order for you to understand how startx works, it is
  659. Ximportant that you know the meanings of the terms window
  660. Xmanager, X resource, X server, and X client.
  661. X
  662. Xo A window manager is a program which allows you to move and
  663. X  resize windows on your display.  These windows act like
  664. X  individual terminal screens which you can manipulate,
  665. X  layer, and move around.
  666. X
  667. Xo An X resource is a personalized attribute of your
  668. X  environment such as color, cursor symbol, etc. You can
  669. X  tailor your X Window session environment to make the
  670. X  cursor symbol change when moved to other windows, make a
  671. X  scroll bar, or make the windows change colors for easier
  672. X  identification.  These are just a few examples of X
  673. X  resources.
  674. X
  675. Xo Your X server communicates and translates all input so
  676. X  that your particular display can understand all the
  677. X  information it receives.  The X server is a combination of
  678. X  the graphics display, keyboard, mouse, hardware, and X
  679. X  server software which accepts input from these devices and
  680. X  provides display services for clients.  The X server
  681. X  software must run locally in order to communicate with
  682. X  these devices.
  683. X
  684. Xo An X client is a program that performs a task such as
  685. X  terminal emulation or window management to shape your X
  686. X  Window System environment.
  687. X
  688. XStartx sets your DISPLAY environment variable to identify
  689. Xthe X server to the X clients.  This enables your X clients
  690. Xto communicate with it and set up your X Window System
  691. Xsession.
  692. X
  693. XYou can find out more about your environment variables by
  694. Xchecking the manual pages of the UNIX shell you are using
  695. X(sh(1), ksh(1L), csh(1), or tcsh(1L)) or by asking a PUCC
  696. Xgeneral consultant for assistance.
  697. X
  698. XCreating a Startup Shell Script File
  699. X
  700. XYou can define and load your X resources and your window
  701. Xmanager easily using a startup shell script file.  Startx
  702. Xreads this file if you use the -x option on the command
  703. Xline, if you name the file in your XINITRC environment
  704. Xvariable, or if you name the file .Xinit, .xinit, .Xinitrc,
  705. X.xinitrc, or .xsession in your home directory.  In this
  706. Xfile, it is your responsibility to start a window manager,
  707. Xload X resources, and create X clients.  A working example
  708. Xof a startup shell script file follows:
  709. X
  710. X   #!/bin/csh
  711. X   (twm &)
  712. X   xrdb -load .xdefaults
  713. X   (xclock -g 75x75+0+0 &)
  714. X   (xbiff  -g 75x75+101-0 &)
  715. X   if ("/dev/console" == "`tty`") then
  716. X     xterm -g 80x24+0+0 +ut -C -T `hostname`
  717. X   else
  718. X     xterm -g 80x24+0+0 +ut -T `hostname`
  719. X   endif
  720. X
  721. XFor a workstation, it is important that the last line in
  722. Xyour startup shell script file be an invocation of xterm(1L)
  723. Xrunning in the foreground with the -C option for console
  724. Xmessages.
  725. X
  726. XFor an X display station, the last line in the startup
  727. Xscript should be an invocation of xterm(1L) running in the
  728. Xforeground without the -C option.  Be aware that some X
  729. Xdisplay stations will not terminate the telnet(1C) session
  730. Xon closing, so you should remember to manually logoff the
  731. Xsession after leaving the X Window session.
  732. X
  733. XNow that you know what a startup file looks like, you can
  734. Xtell startx to read this file in one of three ways.
  735. X
  736. Xo You can use the -x option and a startup shell script file
  737. X  to invoke startx by entering
  738. X  
  739. X     startx -x startup
  740. X
  741. X  In this example, startx will run the given shell script file,
  742. X  startup.  Startx looks for a file specified with the -x
  743. X  option before looking for any other initialization files.
  744. X
  745. Xo You can set your XINITRC environment variable to the
  746. X  startup shell script file name you want to use.  If you
  747. X  don't give any startup shell script file name at the
  748. X  command line using the -x option, then startx looks for a
  749. X  startup shell script file named by your XINITRC
  750. X  environment variable.
  751. X
  752. X  Again, you can find out more about setting your
  753. X  environment variables by checking the manual pages of the
  754. X  UNIX shell you are using (sh(1), ksh(IL), csh(1), or
  755. X  tcsh(1L)) or by asking a PUCC general consultant for
  756. X  assistance.
  757. X
  758. Xo You can name your startup shell script file .Xinit,
  759. X  .xinit, .Xinitrc, .xinitrc, or .xsession to begin the X
  760. X  client programs.  If you haven't used the -x option or set
  761. X  XINITRC, then startx looks in your home directory for any
  762. X  file with the names in the order given above.  It looks
  763. X  for these file names specifically because they are the
  764. X  most common names for initialization files; however, we
  765. X  recommend using the name .xsession for your startup shell
  766. X  script file.
  767. X
  768. XDefining X Attributes Without a Startup File
  769. X
  770. XIf startx doesn't find a startup shell script file, it loads
  771. Xan X resources file which you supply at the command line
  772. Xusing the -r option. This is done by entering
  773. X
  774. X   startx -r resources
  775. X   
  776. Xwhere resources is the name of the X resources configuration
  777. Xfile you wish to use.  (See the xrdb(1L) and x(1L) manual pages
  778. Xfor more information on X resources.)
  779. X
  780. XIf you don't use the -r option, startx looks for a file in
  781. Xyour home directory called .Xdefaults, .xdefaults,
  782. X.Xresources, or .xresources, respectively.  If it doesn't
  783. Xfind any of these X resource files, then your X Window
  784. XSystem session will not have personalized attributes.
  785. X
  786. XAgain, if you don't specify a startup shell script file
  787. Xusing the -x option, startx looks for a window manager
  788. Xindicated at the command line using the -m option.  This is
  789. Xdone by entering
  790. X
  791. X   startx -m window_manager
  792. X   
  793. XIf you don't use the -m option, then startx invokes one of
  794. Xthe window managers twm(1L), awm(1L), or uwm(1L) if it finds
  795. Xone of the associated configuration files in your home
  796. Xdirectory named .twmrc, .awmrc, or .uwmrc, respectively.  If
  797. Xstartx can't find one of the window manager configuration
  798. Xfiles in your home directory, it starts an xterm(1L) client
  799. Xand the twm(1L) window manager by default.
  800. X
  801. XTracing Errors
  802. X
  803. XNot only does startx start all your X clients for you, it
  804. Xalso redirects error messages into a file for any errors
  805. Xencountered while trying to start your X Window System
  806. Xsession.
  807. X
  808. XIf you set your environment variable XERRORS to the name of
  809. Xan errors file, startx will redirect error messages to that
  810. Xfile.  If you don't set your XERRORS environment variable,
  811. Xstartx creates an errors file called .xerrors in your home
  812. Xdirectory and redirects any error messages to that file.
  813. X
  814. XAdditional References
  815. X
  816. XFor more information on the X Window System see the X Window
  817. XSystem User's Guide, Volume Three, by O'Reilly & Associates,
  818. XInc.  This manual is available for loan at the PUCC
  819. XReference/Loan Library in MATH B6.  For a general overview
  820. Xof the X Window System consult the November 1989 issue of
  821. Xthe PUCC Newsletter.
  822. X
  823. X               - George Kraft & Michael Melton
  824. END_OF_FILE
  825. if test 8332 -ne `wc -c <'startx/startx.NewsLetter'`; then
  826.     echo shar: \"'startx/startx.NewsLetter'\" unpacked with wrong size!
  827. fi
  828. # end of 'startx/startx.NewsLetter'
  829. fi
  830. if test -f 'startx/startx.cpp' -a "${1}" != "-c" ; then 
  831.   echo shar: Will not clobber existing file \"'startx/startx.cpp'\"
  832. else
  833. echo shar: Extracting \"'startx/startx.cpp'\" \(5821 characters\)
  834. sed "s/^X//" >'startx/startx.cpp' <<'END_OF_FILE'
  835. X/**/#!/bin/sh
  836. X/**/#
  837. X/**/# 
  838. X/**/#  Copyright 1989 Purdue Research Foundation
  839. X/**/# 
  840. X/**/#  Permission to use, copy, modify, distribute, and sell this software 
  841. X/**/#  and its documentation for any purpose is hereby granted without fee, 
  842. X/**/#  provided that the above copyright notice appear in all copies and that 
  843. X/**/#  both that copyright notice and this permission notice appear in 
  844. X/**/#  supporting documentation, and that the name of Purdue not be used in 
  845. X/**/#  advertising or publicity pertaining to distribution of the software 
  846. X/**/#  without specific, written prior permission.  Purdue makes no 
  847. X/**/#  representations about the suitability of this software for any purpose.  
  848. X/**/#  It is provided "as is" without express or implied warranty.
  849. X/**/# 
  850. X/**/#  PURDUE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
  851. X/**/#  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 
  852. X/**/#  PURDUE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 
  853. X/**/#  ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
  854. X/**/#  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 
  855. X/**/#  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 
  856. X/**/#  SOFTWARE.
  857. X/**/# 
  858. X/**/#  Author:  George Kraft IV (gk4@staff.cc.purdue.edu)
  859. X/**/#           Purdue University Computing Center
  860. X/**/#           Mathematical Sciences Building
  861. X/**/#           West Lafayette, IN 47907
  862. X/**/# 
  863. X/**/#
  864. X/**/#    startx(1L) - Robustly start X on a workstation/displaystation,
  865. X/**/#             employing the user configuration files provided.
  866. X/**/#            
  867. X/**/#            
  868. X/**/#    WORKSTATIONS:        startx
  869. X/**/#            
  870. X/**/#    DISPLAYSTATIONS:     exec; kill -9 $$
  871. X
  872. XPATH=$PATH:BINDIR:UNSUPBINDIR
  873. X
  874. X/**/#    
  875. X/**/#    Current working directory is home.
  876. X/**/#
  877. X
  878. Xcd
  879. X
  880. X/**/#
  881. X/**/#  Parse the arguments.
  882. X/**/#
  883. X
  884. Xusage="USAGE: $0 [-d | -w] [-x <startup> | [-r <resources>] [-m <wmgr>]]"
  885. X
  886. X/**/# How to chop an argument off.
  887. Xcut='P=$1
  888. Xshift
  889. Xset __ -`expr "$P" : '\''-.\(.*\)'\''` "$@"; shift'
  890. X
  891. X/**/# "dwm:r:x:"
  892. Xwhile [ $# -gt 0 ]; do
  893. X    case "$1" in
  894. X    -d)
  895. X        if [ "true" = "${WFLAG-}" ]; then 
  896. X            echo "$usage" 2>&1
  897. X            exit
  898. X        fi
  899. X        DFLAG=true
  900. X        WFLAG=false
  901. X        shift
  902. X        ;;
  903. X    -d*)
  904. X        if [ "true" = "${WFLAG-}" ]; then 
  905. X            echo "$usage" 2>&1
  906. X            exit
  907. X        fi
  908. X        DFLAG=true
  909. X        WFLAG=false
  910. X        eval "$cut"
  911. X        ;;
  912. X    -w)
  913. X        if [ "true" = "${DFLAG-}" ]; then 
  914. X            echo "$usage" 2>&1
  915. X            exit
  916. X        fi
  917. X        WFLAG=true
  918. X        DFLAG=false
  919. X        shift
  920. X        ;;
  921. X    -w*)
  922. X        if [ "true" = "${DFLAG-}" ]; then 
  923. X            echo "$usage" 2>&1
  924. X            exit
  925. X        fi
  926. X        WFLAG=true
  927. X        DFLAG=false
  928. X        eval "$cut"
  929. X        ;;
  930. X    -r)
  931. X        xdefaults=$2
  932. X        shift ; shift
  933. X        ;;
  934. X    -r*)
  935. X        xdefaults=`expr "$1" : '-r\(.*\)'`
  936. X        shift
  937. X        ;;
  938. X    -m)
  939. X        wmrc=$2
  940. X        shift ; shift
  941. X        ;;
  942. X    -m*)
  943. X        wmrc=`expr "$1" : '-m\(.*\)'`
  944. X        shift
  945. X        ;;
  946. X    -x)
  947. X        xinitrc=$2
  948. X        shift ; shift
  949. X        ;;
  950. X    -x*)
  951. X        xinitrc=`expr "$1" : '-m\(.*\)'`
  952. X        shift
  953. X        ;;
  954. X    --)
  955. X        shift
  956. X        break
  957. X        ;;
  958. X    -*)
  959. X        echo "$usage" 1>&2 
  960. X        exit 1
  961. X        ;;
  962. X    *)
  963. X        break
  964. X        ;;
  965. X    esac
  966. Xdone
  967. X
  968. Xif [ $# -gt 0 ]; then
  969. X    echo "$usage" 1>&2 
  970. X    exit 1
  971. Xfi
  972. X
  973. Xif [ "" != "${xinitrc-}" ]; then 
  974. X    if [ "" != "${wmrc-}" ]; then 
  975. X        echo "$usage" 1>&2 
  976. X        echo -n "Window manager option unexpected " 1>&2
  977. X        echo "with X startup option." 1>&2
  978. X        exit 1
  979. X    fi
  980. X    if [ "" != "${xdefaults-}" ]; then 
  981. X        echo "$usage" 1>&2 
  982. X        echo "X resources option unexpected with X startup option." 1>&2
  983. X        exit 1
  984. X    fi
  985. Xfi
  986. X
  987. XTTYNAME=`tty | sed -e "s/\/dev\///"`
  988. X
  989. Xif [ "${WFLAG-}" = "" ]; then
  990. X    case "$TTYNAME" in
  991. X    console | co)
  992. X        WFLAG="true"
  993. X        DFLAG="false"
  994. X        ;;
  995. X    *)
  996. X        DFLAG="true"
  997. X        WFLAG="false"
  998. X        ;;
  999. X    esac
  1000. Xfi
  1001. X
  1002. X/**/#
  1003. X/**/#    Find a xrdb(1L) configuration file.
  1004. X/**/#
  1005. X
  1006. Xxrdbconfigs="${xdefaults-} .Xdefaults .xdefaults .Xresources .xresources"
  1007. X
  1008. Xfor config in $xrdbconfigs; do
  1009. X    if [ -r $config -a -s $config ]; then
  1010. X        xrdbconfig="$config"
  1011. X        break;
  1012. X    fi
  1013. Xdone
  1014. X
  1015. X/**/#
  1016. X/**/#    Find a X configuration file.
  1017. X/**/#
  1018. X
  1019. Xxconfigs="${xinitrc-} ${XINITRC-} .Xinit .xinit .Xinitrc .xinitrc .xsession"
  1020. X
  1021. Xfor config in $xconfigs; do
  1022. X    if [ -r $config -a -s $config ]; then
  1023. X
  1024. X        xconfig="$config"
  1025. X
  1026. X/**/        #
  1027. X/**/        # Determine the shell of the X config file.
  1028. X/**/        #
  1029. X
  1030. X        if [ "`head -1 $xconfig | grep "/bin/sh"`" ]; then
  1031. X            shell="/bin/sh"
  1032. X        else
  1033. X            shell="/bin/csh"
  1034. X        fi
  1035. X
  1036. X        break;
  1037. X    fi
  1038. Xdone
  1039. X
  1040. X/**/#
  1041. X/**/#    Find a window manager configuration file.
  1042. X/**/#
  1043. X
  1044. Xwmgrconfigs="${wmrc-} .twmrc .awmrc .uwmrc"
  1045. X
  1046. Xfor config in $wmgrconfigs; do
  1047. X    if [ -r $config -a -s $config ]; then
  1048. X        wmgrconfig="$config"
  1049. X        break;
  1050. X    fi
  1051. Xdone
  1052. X
  1053. X/**/#
  1054. X/**/#    Determine which error file to use.
  1055. X/**/#
  1056. X
  1057. Xxerrors=${XERRORS=.xerrors}
  1058. X
  1059. X/**/#
  1060. X/**/#    Does the user know which DISPLAY to send to? 
  1061. X/**/#
  1062. X
  1063. Xif [ "${DFLAG-}" = "true" -a "${DISPLAY-}" = "" ]; then
  1064. X    export DISPLAY
  1065. X    DISPLAY=`who am i | sed -e 's/\(.*\)(\(.*\))/\2/'`:0
  1066. X    echo "Environment variable DISPLAY was set to $DISPLAY"
  1067. Xelif [ "${WFLAG-}" = "true" -a "${DISPLAY-}" = "" ]; then
  1068. X    export DISPLAY
  1069. X    DISPLAY=`hostname|sed -e 's/\.edu$//' -e 's/\.purdue$//' -e 's/\.cc$//'`:0
  1070. Xfi
  1071. X
  1072. X/**/#
  1073. X/**/#    Start X.
  1074. X/**/#
  1075. X
  1076. Xif [ "${xconfig-}" != "" ]; then
  1077. X    if [ -r $xconfig -a -s $xconfig ]; then
  1078. X        if [ "${WFLAG-}" = "true" ]; then
  1079. X            xinit /bin/sh -c "DISPLAY=$DISPLAY $shell $xconfig" \
  1080. X            > $xerrors 2>&1; kbd_mode -a; clear
  1081. X            exit 0
  1082. X        else
  1083. X            echo -n "Suspend your telnet(1C) session and wait for "
  1084. X            echo    "the window manager."
  1085. X            ($shell $xconfig > $xerrors 2>&1 &)
  1086. X            exit 0
  1087. X        fi
  1088. X    fi
  1089. Xfi
  1090. X
  1091. Xif [ "${WFLAG-}" = "true" ]; then
  1092. X    (xinit /bin/sh -c "DISPLAY=$DISPLAY xterm -C" > $xerrors 2>&1; \
  1093. X    kbd_mode -a; clear &)
  1094. X    sleep 10
  1095. X    if [ -r .xauth -a -s .xauth ]; then
  1096. X        xhost + > $xerrors 2>&1
  1097. X    fi
  1098. Xelse
  1099. X    echo "Suspend your Telnet(1C) session and wait for the window manager."
  1100. Xfi
  1101. X
  1102. Xcase "$wmgrconfig" in
  1103. X.awmrc)
  1104. X    (awm > $xerrors 2>&1 &)
  1105. X    ;;
  1106. X.uwmrc)
  1107. X    (uwm > $xerrors 2>&1 &)
  1108. X    ;;
  1109. X.twmrc | *)
  1110. X    (twm > $xerrors 2>&1 &)
  1111. X    ;;
  1112. Xesac
  1113. X
  1114. Xif [ "${xrdbconfig-}" != "" ]; then
  1115. X    xrdb $xrdbconfig > $xerrors 2>&1
  1116. Xfi
  1117. X
  1118. Xif [ "${WFLAG-}" = "true" ]; then
  1119. X    wait
  1120. Xelse
  1121. X    (xterm > $xerrors 2>&1 &)
  1122. Xfi
  1123. END_OF_FILE
  1124. if test 5821 -ne `wc -c <'startx/startx.cpp'`; then
  1125.     echo shar: \"'startx/startx.cpp'\" unpacked with wrong size!
  1126. fi
  1127. # end of 'startx/startx.cpp'
  1128. fi
  1129. if test -f 'startx/startx.newsletter' -a "${1}" != "-c" ; then 
  1130.   echo shar: Will not clobber existing file \"'startx/startx.newsletter'\"
  1131. else
  1132. echo shar: Extracting \"'startx/startx.newsletter'\" \(10122 characters\)
  1133. sed "s/^X//" >'startx/startx.newsletter' <<'END_OF_FILE'
  1134. X.\" 
  1135. X.\" ltroff -tbl -pic startx.newletter
  1136. X.\" 
  1137. X.\" 
  1138. X.\" eqn tbl
  1139. X.\" 
  1140. X.nr O 1i
  1141. X.nr W 6.5i
  1142. X.so /usr/lib/tmac/tmac.m
  1143. X.fp 4 HX
  1144. X.de TP
  1145. X.vs 12
  1146. X.sp 2
  1147. X.sp .5
  1148. X.ps 16
  1149. X.if e 'tl '\f(HXannouncements''\fR'
  1150. X.if o 'tl '''\f(HXannouncements''\fR'
  1151. X.sp -2
  1152. X.ps 160
  1153. X.tl '\fB___'___'___\fR'
  1154. X.sp 6
  1155. X..
  1156. X.BS
  1157. X.ps 80
  1158. X\l'6.5i'
  1159. X.ps 10
  1160. X.sp 1
  1161. X.BE
  1162. X.EF "'\s+6\f(HX%\s-4''PUCC Newsletter\fR\s-2'"
  1163. X.OF "'\s+2\f(HXNovember 1989''\s+4%\fR\s-6'"
  1164. X.EQ
  1165. Xdelim off
  1166. Xgfont italic, gsize 10
  1167. X.EN
  1168. X.S 10 12
  1169. X.nr Pi 5
  1170. X.nr Pt 1
  1171. X.SA 1
  1172. X.de HX
  1173. X.if \\n(;1=1 \{\
  1174. X.sp 2
  1175. X.ps 80
  1176. X\l'2.75'
  1177. X.ps 10
  1178. X.ft HX
  1179. X.sp .15\}
  1180. X.if \\n(;1=1 .vs 18
  1181. X..
  1182. X.de HZ
  1183. X.vs 12
  1184. X.sp .5
  1185. X..
  1186. X.ds HP 16 16 16 16 16 16 16
  1187. X.ds HF 4 1 1 1 1 1 1
  1188. X.HM 1 1 1 1 1 1 1
  1189. X.nr Hb 5
  1190. X.nr Hs 5
  1191. X.nr Hi 1
  1192. X.nr Hc 0
  1193. X.nr Hu 1
  1194. X.nr Cl 7
  1195. X.nr Ci 10 5 5 5 5 5 5
  1196. X.de ES
  1197. X.ft CW
  1198. X'in +3
  1199. X.nf
  1200. X.S 9 10
  1201. X'sp .75
  1202. X..
  1203. X.de EE
  1204. X.if "\\$1""  .sp .75  \" spacing before regular following text
  1205. X.if "\\$1"1" .sp .75  \" spacing before regular following text
  1206. X.if "\\$1"2" .sp .25  \" spacing before paragraph .P
  1207. X.if "\\$1"3" .sp 0    \" 0 extra spacing before subheading
  1208. X.\" takes one argument (null, 1, 2, or 3) to determine spacing 
  1209. X.\" after example end
  1210. X.S 10 12
  1211. X'in
  1212. X.ft R
  1213. X.fi
  1214. X..
  1215. X.de )k
  1216. X..
  1217. X.2C
  1218. X.bp
  1219. X.1C
  1220. X.PS
  1221. Xbox wid 6.5i ht 2.5i
  1222. X.PF
  1223. X.sp 1.5
  1224. X.ll -2
  1225. X.in +2
  1226. X.ce
  1227. X\s+2\f(HXThe Syntax of the Startx UNIX Utility and Its Options\fR\s-2
  1228. X.sp
  1229. XThe syntax of the UNIX \fIstartx\fR command and its options is
  1230. X.ES
  1231. Xstartx [\|-d | -w\|] [\|-x \fIstartup\fP | [\|-r \fIresources\fP | -m \fIwindow_manager\fP\|] ]
  1232. X.EE
  1233. Xwhich represents two sets of options.  The first set consists of
  1234. Xthe options \fB-d\fR
  1235. Xor \fB-w\fR which helps \fIstartx\fR
  1236. Xdistinguish which type of terminal you are using.
  1237. XThese options will only be used in rare circumstances and you
  1238. Xshould consult the manual page for more details.
  1239. X.sp
  1240. XThe second
  1241. Xset of options consists of a choice between setting up your
  1242. XX Windows System environment with one shell script file
  1243. Xusing the \fB-x\fR option,
  1244. Xor by specifying your X resources and window manager separately
  1245. Xusing the \fB-r\fR and \fB-m\fR options.
  1246. XYou should note that you can use one or both
  1247. Xof the \fB-m\fR and \fB-r\fR options,
  1248. Xor the \fB-x\fR option,
  1249. Xbut you cannot use the \fB-x\fR option
  1250. Xin conjunction with the \fB-m\fR and \fB-r\fR options.
  1251. X.ll +2
  1252. X.in -2
  1253. X.PE
  1254. X.sp 2
  1255. X.2C
  1256. X.HU "Startx UNIX Utility Makes the X Windows System Easy"
  1257. X\fRThe \fIX Windows System\fR is
  1258. Xa network-based, graphics window system which
  1259. Xwas developed at MIT in 1984.
  1260. XThe most recent version, X11, was 
  1261. Xreleased in 1987,
  1262. Xand is the version we currently have running.
  1263. XThe X Windows System is available on all of our Sequent Symmetries
  1264. Xrunning the DYNIX operating system, Sun workstations running SunOS,
  1265. Xand the VAX 8800 running the ULTRIX operating system.
  1266. X.P
  1267. XThere are many ways to initiate an X Windows System session
  1268. Xwhich require you to go through several steps to create a working
  1269. Xenvironment.
  1270. XThe \fIStartx\fR UNIX utility
  1271. Xis designed to ease your burden
  1272. Xby allowing you to start your window manager,
  1273. Xdefine and load your X resources, and
  1274. Xinitiate other X clients in one command.  
  1275. X.sp
  1276. X\fBWindow Managers, X Resources,
  1277. X.br
  1278. XX Servers and X Clients\fR
  1279. X.sp
  1280. XIn order for you to understand how \fIstartx\fR works it is important
  1281. Xthat you know the meanings of the terms \fIwindow manager, X resources, 
  1282. X\fIX server\fR and \fIX clients\fR.
  1283. X.BL 2
  1284. X.LI
  1285. XA \fIwindow manager\fR is a program which allows you to move, resize and
  1286. Xcirculate windows on your display.
  1287. XThese windows act like individual
  1288. Xscreens which you can manipulate, layer and move around.
  1289. X.LI
  1290. X\fIX resources\fR are personalized 
  1291. Xattributes of your environment such as color, cursor symbol, etc.  
  1292. XYou can tailor your X Windows Session environment to make the cursor 
  1293. Xsymbol change when moved to other windows, make a scroll bar,
  1294. Xor make the windows change
  1295. Xcolors for easier identification.  These are just a few examples of
  1296. X\fIX resources\fR.
  1297. X.LI
  1298. XYour \fIX server\fR communicates and translates all input so that your
  1299. Xparticular display can understand all the information it receives.
  1300. XIt is a combination of the graphics display, keyboard,
  1301. Xmouse, hardware, and X server software which accepts input from these
  1302. Xdevices and provides display services for clients.
  1303. XThe \fIX server\fR software must run locally in order to communicate
  1304. Xwith these devices.  
  1305. X.LI
  1306. X\fIX clients\fR are programs that perform tasks 
  1307. Xsuch as terminal emulation or window management
  1308. Xto shape your X Windows System environment.
  1309. X.LE
  1310. X.sp
  1311. X\fIStartx\fR sets your
  1312. XDISPLAY environment variable
  1313. Xto identify the X server to the X clients.
  1314. XThis enables your X clients to communicate with it
  1315. Xand set up your X Windows System session.
  1316. X.sp
  1317. XYou can find out more about your environment variables
  1318. Xby checking the man pages of the UNIX shell you are using
  1319. X(\fIsh\fR(1), \fIcsh\fR(1), or \fIksh\fR(1L))
  1320. Xor by asking a PUCC general consultant for assistance.
  1321. X.sp
  1322. X\fBCreating a Startup Shell Script File\fR
  1323. X.sp 
  1324. XYou can define and load your X resources 
  1325. Xand your window manager easily using a
  1326. Xstartup shell script file.
  1327. X\fIStartx\fR reads this file if you use the \fB-x\fR option
  1328. Xon the command line,
  1329. Xif you name the file in your XINITRC environment variable, or
  1330. Xif you named the 
  1331. Xfile\fI .Xinit, .xinit, .Xinitrc, .xinitrc\fR, or \fI.xsession\fR.
  1332. XIn this file, 
  1333. Xit is your responsibility to start
  1334. Xa window manager, load X resources and create X clients.
  1335. XA working example of a startup shell script file
  1336. Xfollows:
  1337. X.ES
  1338. X.in -.5i
  1339. X#!/bin/csh
  1340. X(twm &)
  1341. Xxrdb -load .xdefaults
  1342. X(xclock -g 75x75+0+0 &)
  1343. X(xbiff  -g 75x75+101-0 &)
  1344. Xif ("/dev/console" == "`tty`") then
  1345. X\ \ xterm -g 80x24+0+0 +ut -C -T `hostname`
  1346. Xelse
  1347. X\ \ xterm -g 80x24+0+0 +ut -T `hostname`
  1348. Xendif
  1349. X.EE 1
  1350. X.in -.5i
  1351. XFor a workstation, it is important that
  1352. Xthe last line in your startup shell script file
  1353. Xbe \fIxterm\fR(1L)
  1354. Xrunning in the foreground with the \fB-C\fR option for console
  1355. Xmessages.
  1356. X.sp
  1357. XFor an X display station, the last line in the startup script
  1358. Xshould be \fIxterm\fR(1L) running in the foreground
  1359. X\fIwithout\fR the \fB-C\fR option.
  1360. XBe aware that some X display stations will not
  1361. Xterminate the \fItelnet\fR(1C) session on closing,
  1362. Xtherefore, you should remember to manually logoff
  1363. Xthe session before going to,
  1364. Xor after leaving,
  1365. Xthe X Windows session.
  1366. X.sp
  1367. XNow that you know what a startup file looks like
  1368. Xyou can tell \fIstartx\fR to read this file in one of three ways.
  1369. X.BL 2
  1370. X.LI
  1371. X\fRYou can use the \fB-x\fR option and a startup
  1372. Xshell script file to invoke \fIstartx\fR
  1373. Xby entering
  1374. X.ES
  1375. Xstartx -x \fIstartup
  1376. X.EE 2
  1377. XIn this example, \fIstartx\fR will run the given shell script file,
  1378. X\fIstartup\fR.
  1379. X\fIStartx\fR looks for a file specified with the \fB-x\fR option
  1380. Xbefore looking for any other initialization files.
  1381. X.LI
  1382. X\fRYou can set your XINITRC environment variable to the
  1383. Xstartup shell script file name you want to use.
  1384. XIf you don't give any startup shell script file name
  1385. Xat the command line using the \fB-x\fR option,
  1386. Xthen \fIstartx\fR looks for a startup shell script
  1387. Xfile named by your XINITRC 
  1388. Xenvironment variable.  
  1389. X.sp
  1390. XAgain, you can find out more about setting your environment variables
  1391. Xby checking the man pages of the UNIX shell you are using
  1392. X(\fIsh\fR(1), \fIcsh\fR(1), or \fIksh\fR(1L))
  1393. Xor by asking a PUCC general consultant for assistance.
  1394. X.LI
  1395. XYou can name your startup shell script 
  1396. Xfile \fI.Xinit, .xinit, .Xinitrc, .xinitrc,\fR 
  1397. Xor \fI.xsession,\fR to begin the X client programs.
  1398. XIf you haven't used the \fB-x\fR option or set XINITRC,
  1399. Xthen \fIstartx\fR
  1400. Xlooks in your home directory for any file with the above
  1401. Xnames in their respective order.
  1402. XIt looks for these file names 
  1403. Xspecifically because they
  1404. Xare the most common names for initialization files, however,
  1405. Xwe recommend using the name \fI.xsession\fR
  1406. Xfor your startup shell script file. 
  1407. X.LE
  1408. X.sp
  1409. X\fBDefining X Attributes Without a Startup File\fR
  1410. X.sp
  1411. X\fRIf \fIstartx\fR doesn't find a startup 
  1412. Xshell script file, it 
  1413. Xloads a \fIresources\fR file which you supply at the command line
  1414. Xusing the \fB-r\fR option. 
  1415. XThis is done by entering
  1416. X.ES
  1417. Xstartx -r \fIresources 
  1418. X.EE 1
  1419. Xwhere \fIresources\fR is the name of the X resources configuration
  1420. Xfile you wish to use.
  1421. X(See the \fIxrdb\fR(1L) and \fIx\fR(1L) man pages
  1422. Xfor more information on X resources.)
  1423. X.sp
  1424. XIf you don't use the \fB-r\fR option, \fIstartx\fR looks for 
  1425. Xa file in your home directory 
  1426. Xcalled \fI.Xdefaults, .xdefaults, .Xresources,\fR 
  1427. Xor \fI.xresources,\fR respectively.
  1428. XIf it doesn't find any of these X resource files,
  1429. Xthen your X Windows System session will not have personalized
  1430. Xattributes.
  1431. X.sp
  1432. X\fRAgain, if no startup shell script file
  1433. Xis specified using the \fB-x\fR option, \fIstartx\fR 
  1434. Xlooks for a window manager
  1435. Xindicated at the command line using the \fB-m\fR option.
  1436. XThis is done by entering
  1437. X.ES
  1438. Xstartx -m \fIwindow_manager
  1439. X.EE 2
  1440. XIf you don't use the \fB-m\fR option, then
  1441. X\fIstartx\fR invokes the 
  1442. Xwindow manager \fItwm\fR(1L), \fIawm\fR(1L), or \fIuwm\fR(1L) if it finds
  1443. Xan associated configuration file 
  1444. Xin your home directory named \fI.twmrc, .awmrc,\fR 
  1445. Xor \fI.uwmrc\fR, respectively.
  1446. XIf \fIstartx\fR can't find such a window manager configuration 
  1447. Xfile in your home directory, it initiates 
  1448. Xan \fIxterm\fR(1L) client and the \fItwm\fR(1L) window manager
  1449. Xby default.
  1450. X.sp
  1451. X\fBTracing Errors\fR
  1452. X.sp
  1453. XNot only does \fIstartx\fR start all your X clients for you, it also 
  1454. Xredirects error messages into a file
  1455. Xfor any errors encountered 
  1456. Xwhile trying to start your X Windows System session.
  1457. XIf you set your environment variable XERRORS
  1458. Xto the name of an errors file you want, \fIstartx\fR will redirect the
  1459. Xerror messages to that file.
  1460. X.sp
  1461. XIf you don't set your XERRORS environment variable,
  1462. X\fIstartx\fR
  1463. Xcreates an errors file called \fI.xerrors\fR in you home directory
  1464. Xand redirects any error messages to that file by default.
  1465. X.sp
  1466. X\fBAdditional References\fR
  1467. X.sp
  1468. XFor more information on the X Windows System see
  1469. Xthe \fIX Window System User's Guide, Volume Three,\fR 
  1470. Xby O'Reilly & Associates, Inc.
  1471. XThis manual is available for loan
  1472. Xat the PUCC Reference/Loan Library in MATH B6.
  1473. XFor a general overview of the X Windows System
  1474. Xconsult the November 1989 issue of the \fIPUCC Newsletter\fR. 
  1475. X.sp -.5
  1476. X.TS
  1477. Xrw(3.06i) .
  1478. X\(em \fIGeorge Kraft &\fR
  1479. X\fIMichael Melton\fR
  1480. X.TE
  1481. END_OF_FILE
  1482. if test 10122 -ne `wc -c <'startx/startx.newsletter'`; then
  1483.     echo shar: \"'startx/startx.newsletter'\" unpacked with wrong size!
  1484. fi
  1485. # end of 'startx/startx.newsletter'
  1486. fi
  1487. echo shar: End of archive 1 \(of 1\).
  1488. cp /dev/null ark1isdone
  1489. MISSING=""
  1490. for I in 1 ; do
  1491.     if test ! -f ark${I}isdone ; then
  1492.     MISSING="${MISSING} ${I}"
  1493.     fi
  1494. done
  1495. if test "${MISSING}" = "" ; then
  1496.     echo You have the archive.
  1497.     rm -f ark[1-9]isdone
  1498. else
  1499.     echo You still need to unpack the following archives:
  1500.     echo "        " ${MISSING}
  1501. fi
  1502. ##  End of shell archive.
  1503. exit 0
  1504.